<!DOCTYPE html>
<html lang="zh-cn">
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <#include "/common/meta.ftl"/>
	    <script src="${_b}/static/other/jquery.layout-latest.js"></script>
	    <link rel="stylesheet" href="${_b}/static/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
	    <script type="text/javascript" src="${_b}/static/zTree_v3/js/jquery.ztree.all.js"></script>
		<script>
			var setting = {
				view: {
					selectedMulti: false
				},
				async: {
					enable: true,
					url: "./organTree"
				},
				data: {
					simpleData: {
						enable: true
					}
				},
				callback: {
					onAsyncSuccess: function (event, treeId, treeNode, msg) {
					    var zTree = $.fn.zTree.getZTreeObj("organTree");
						var node = zTree.getNodeByTId("tree_1");
						//alert(node.id)
						if(node&&node.id!='0'){
							$("#organIframe").attr("src" , "./organForm?organID=" + node.id);
						}
					},
					onClick: function(event, treeId, treeNode){
						if(treeNode.id!='0'){
							$("#organIframe").attr("src" , "./organForm?organID=" + treeNode.id+"&noCache="+Math.random());
						}
					}
				}
			};
			var myLayout;
			$(function(){
				$.fn.zTree.init($("#organTree"), setting);
				
				var westWidth = $(window).width()/4.5;
				myLayout = $('body').layout({
					resizerTip : "拖拽调整大小",
					west__minSize : 200,
					west__closable:false,//可以被关闭
					resizerDragOpacity:0.9,//调整大小边框移动时的透明度    
					west__size:					westWidth,
					center__maskContents:		true // IMPORTANT - enable iframe masking
				});
			});
			
		</script>
		<style>
			.ui-layout-resizer { /* all 'resizer-bars' */ 
				background: #DDD; 
			} 
			.ui-layout-pane-west { /* west pane */ 
				background-color: #f5f5f5 !important;
				overflow: auto;
				margin:5px;
				border:1px solid #ddd;
			} 
			body{
				padding:5px;
			}
		</style>
	</head>
	<body style="" class="">
		<iframe id="organIframe" name="organIframe" class="ui-layout-center" width="100%" height="100%" frameborder="0" scrolling="auto"
			src="./organForm"></iframe>
		<div class="ui-layout-west " style="">
			<div style="padding:5px;">
				<ul id="organTree" class="ztree"></ul>
			</div>
		</div>
	</body>
</html>